<template>
	<view class="select-box" @click="click">
		<u-select v-model="show" :list="list" :default-value="defaultValue" @confirm="confirm"></u-select>
		<view class="select-box_title">{{title}}</view>

	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: ''
			},
			defaultValue: {
				type: Array,
				default() {
					return [0];
				}
			},
			// 列数据
			list: {
				type: Array,
				default() {
					return [];
				}
			},
		},
		name: "b-select",
		data() {
			return {
				show: false,
			};
		},
		methods: {
			click() {
				this.show = true;
			},
			confirm(e) {
				this.$emit('confirm', e);
			}
		}
	}
</script>

<style lang="scss">
	.select-box {
		display: flex;
		flex: 1;
		flex-direction: row;

		.select-box_title {
			margin-right: 20rpx;
			width: 300rpx;
			text-align: right;
		}
	}
</style>
